package 二分查找;

import java.util.Scanner;

public class 分巧克力 {
    static int[][] c = new int[100010][2];
    static int m;
    static int n;
    static int k;

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        n = scanner.nextInt();
        k = scanner.nextInt();
        //n行
        for (int i = 1; i <= n; i++) {
            c[i][0] = scanner.nextInt();
            c[i][1] = scanner.nextInt();
            m = Integer.max(m, c[i][0]);
            m = Integer.max(m, c[i][1]);  //巧克力的最大边长
        }
        int i = binarySearch();
        System.out.println(i);
    }

    public static int binarySearch() {
        int l = 1, r = m;
        while (l < r) {
            int mid = (l + r + 1) >>> 1;
            if (check(mid)) {
                l = mid;
            } else {
                r = mid - 1;
            }
        }
        return l;
    }

    private static boolean check(int mid) { //求出巧克力变成为mid时 分成的分数能不能满足k
        int cot = 0;
        for (int i = 1; i <= n; i++) {
            cot += (c[i][0] / mid) * (c[i][1] / mid);
        }
        if (cot >= k) {
            return true;
        } else {
            return false;
        }

    }
}
